package DARCOShared.utils;

import java.text.SimpleDateFormat;


public interface Constants {
	public static final String EMAIL_PATTERN=
			"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
	public static final String DATETIME_FORMAT="yyyy-MM-dd HH:mm:ss";
	public static final SimpleDateFormat iso8601Format= new SimpleDateFormat(DATETIME_FORMAT);
	
	public static final String TABLE_NAME_ACCOUNTS="accounts";
	public static final String ACCOUNT_ID = "id";	
	public static final String ACCOUNT_EMAIL = "email";	
	public static final String ACCOUNT_NAME = "name";
	public static final String ACCOUNT_SURNAME ="surname";
	public static final String ACCOUNT_USERNAME ="username";
	public static final String ACCOUNT_PASSWORD ="password";
	public static final String ACCOUNT_LASTLOC ="lastLocation";
	public static final String ACCOUNT_CREATION="creation";
	public static final String ACCOUNT_KEYPAIR="keypair";
	public static final String ACCOUNT_AVATAR ="avatar";
	public static final String[] ACCOUNTS_FIELDS={
			ACCOUNT_ID, ACCOUNT_EMAIL, ACCOUNT_NAME,ACCOUNT_SURNAME, ACCOUNT_USERNAME,
			ACCOUNT_PASSWORD,ACCOUNT_LASTLOC, ACCOUNT_CREATION, ACCOUNT_KEYPAIR, ACCOUNT_AVATAR};
	
	public static final String TABLE_NAME_CARDS="cards";
	public static final String CARD_SN="cardSN";
	public static final String CARD_NAME="cardName";
	public static final String CARD_STATS="cardStats";
	public static final String CARD_SPECIAL="cardSpecial";
	public static final String CARD_CATEGORY="cardCategory";
	public static final String CARD_SUBCATEGORY="cardSubCategory";
	
	//
	public static final String CARD_CATEGORY_NAME="cardCategoryName";
	public static final String CARD_SUBCATEGORY_NAME="cardSubCategoryName";
	//
	public static final String CARD_PREVIEW="cardPreview";
	public static final String CARD_IMAGE="cardImage";
	public static final String[] CARDS_FIELDS={CARD_SN,CARD_NAME,CARD_STATS,CARD_SPECIAL,CARD_CATEGORY,
			CARD_SUBCATEGORY,CARD_PREVIEW,CARD_IMAGE};
	
	
	public static final String TABLE_NAME_UNIQUECARDS="uniquecards";
	public static final String UNIQUECARD_SN="uniquecardSN";
	public static final String UNIQUECARD_ID="uniquecardID";
	public static final String UNIQUECARD_ACTUALOWNER="actualOwner";
	public static final String UNIQUECARD_AUTENTICATED="authenticated";
	public static final String UNIQUECARD_FIRSTAUTH="firstAuthent";
	public static final String UNIQUECARD_FIRSTOWNER="firstOwner";
	public static final String[] UNIQUECARDS_FIELDS={UNIQUECARD_SN,UNIQUECARD_ID,
				UNIQUECARD_ACTUALOWNER, UNIQUECARD_AUTENTICATED, UNIQUECARD_FIRSTAUTH, UNIQUECARD_FIRSTOWNER};
	public static final String UNIQUECARD_SN_AND_ID="uniquecardSNandID";
	
	public static final String TABLE_NAME_CATEGORIES="categories";
	public static final String CATEGORY_ID="categoryID";
	public static final String CATEGORY_NAME="categoryName";
	public static final String CATEGORY_ALLOWSUB="allowSub";
	public static final String[] CATEGORIES_FIELDS={CATEGORY_ID, CATEGORY_NAME,CATEGORY_ALLOWSUB};

	public static final String TABLE_NAME_TRADES="trades";
	public static final String TRADE_LOCAL_ID="localID";
	public static final String TRADE_ID="tradeID";
	public static final String TRADE_CARDSN="cardSN";
	public static final String TRADE_CARDID="cardID";
	public static final String TRADE_OLDOWNER="oldOwner";
	public static final String TRADE_NEWOWNER="newOwner";
	public static final String TRADE_DATE="dateTrade";
	public static final String TRADE_VERIFIED="verified";
	public static final String TRADE_LATITUDE="latitude";
	public static final String TRADE_LONGITUDE="longitude";
	public static final String TRADE_SERVER_SIGNATURE="signature";
	public static final String[] TRADES_FIELDS={TRADE_LOCAL_ID,TRADE_ID,TRADE_CARDSN,TRADE_CARDID,
			TRADE_OLDOWNER,TRADE_NEWOWNER,TRADE_DATE,TRADE_VERIFIED, TRADE_LATITUDE, TRADE_LONGITUDE, TRADE_SERVER_SIGNATURE};
	public static final String TRADE_CARDSN_AND_CARDID = "tradeCardSNandID";
			
	public static final String TABLE_NAME_SYSTEM="system";
	public static final String SYSTEM_APPCODE="appCode";
	public static final String SYSTEM_SAVEDACCOUNT="savedAccount";
	public static final String SYSTEM_FIRSTSTART="firstStart";
	public static final String SYSTEM_ALLOWLOCATION="allowLocation";
	public static final String[] SYSTEM_FIELDS={SYSTEM_APPCODE,SYSTEM_SAVEDACCOUNT,SYSTEM_FIRSTSTART,SYSTEM_ALLOWLOCATION};

	public static final String TABLE_NAME_SECURITY="security";
	public static final String SECURITY_KEYPAIR="keypair";
	
	//gestione dell'origine della visualizzazione
	public static final String VISUALIZATION_ORIGIN	=	"ORIGIN";
	public static final int VISUALIZATION_FROM_BT_RECEIVE	=	0;
	public static final int VISUALIZATION_FROM_CARD_LIST	=	1;
	public static final int VISUALIZATION_FROM_QRSCAN4INFO	=	2;

	//modalita' dell'activity che mostra la mappa, messe qui per renderle disponibili anche al darcoserver
	public static final int MODE_CARD_JOURNEY = 10;
	public static final int MODE_LOCATE_SPECIFIC_USER = 11;
	public static final int MODE_LOCATE_USERS_NEAR_ME = 12;
	public static final int MODE_LOCATE_CARD_OWNERS_NEAR_ME = 13;
}
